import request from '@/utils/request'

// 查询次卡销售列表
export function listCountSale(query) {
  return request({
    url: '/crm/countSale/list',
    method: 'get',
    params: query
  })
}

export function checkValid(meId,cardId) {
  return request({
    url: '/crm/countSale/checkValid?meId=' + meId+'&cardId='+cardId,
    method: 'get'
  })
}

//开卡
export function openCard(id) {
  return request({
    url: '/crm/countSale/openCard?id=' + id,
    method: 'get'
  })
}

// 下卡
export function downCard(data) {
  return request({
    url: '/crm/countSale/downCard',
    method: 'post',
    data: data
  })
}


// 销卡
export function offCard(data) {
  return request({
    url: '/crm/countSale/offCard',
    method: 'post',
    data: data
  })
}


// 查询次卡销售详细-
export function getByOrderId(orderId) {
  return request({
    url: '/crm/countSale/getByOrderId?orderId=' + orderId,
    method: 'get'
  })
}


// 查询次卡销售详细
export function getCountSale(id) {
  return request({
    url: '/crm/countSale/' + id,
    method: 'get'
  })
}

// 新增次卡销售
export function addCountSale(data) {
  return request({
    url: '/crm/countSale',
    method: 'post',
    data: data
  })
}

// 修改次卡销售
export function updateCountSale(data) {
  return request({
    url: '/crm/countSale',
    method: 'put',
    data: data
  })
}

// 删除次卡销售
export function delCountSale(id) {
  return request({
    url: '/crm/countSale/' + id,
    method: 'delete'
  })
}
